import Vue from 'vue';
import Router from 'vue-router';

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err);
};
Vue.use(Router);

export default new Router({
    // mode: 'hash',
    base: '/sys/',
    routes: [
        {
            path: '/',
            redirect: '/customer'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/customer',
                    component: () => import('../components/page/CustomerAdministration/Customer.vue'),
                    meta: { title: '今日待办' }
                },
                {
                    path: '/WaitCustomer',
                    component: () => import('../components/page/CustomerAdministration/WaitCustomer.vue'),
                    meta: { title: '我的客户' }
                },
                {
                    path: '/Redistribution',
                    component: () => import('../components/page/CustomerAdministration/Redistribution.vue'),
                    meta: { title: '再分配客户' }
                },
                {
                    path: '/XingCustomer',
                    component: () => import('../components/page/CustomerAdministration/XingCustomer.vue'),
                    meta: { title: '重要客户' }
                },
                {
                    path: '/CallDuration',
                    component: () => import('../components/page/CustomerAdministration/CallDuration.vue'),
                    meta: { title: '通时通次' }
                },
                {
                    path: '/AccessUser',
                    component: () => import('../components/page/CustomerAdministration/AccessUser.vue'),
                    meta: { title: '今日到访' }
                },
                {
                    path: '/soundRecording',
                    component: () => import('../components/page/CustomerAdministration/soundRecording.vue'),
                    meta: { title: '通话录音' }
                },
                {
                    path: '/performance',
                    component: () => import('../components/page/CustomerAdministration/performance.vue'),
                    meta: { title: '业绩排行' }
                },
                {
                    path: '/operate',
                    component: () => import('../components/page/CustomerAdministration/operate.vue'),
                    meta: { title: '签单客户' }
                },
                {
                    path: '/terminal',
                    component: () => import('../components/page/CustomerAdministration/terminal.vue'),
                    meta: { title: '工作终端' }
                },
                {
                    path: '/CustomerLists',
                    component: () => import('../components/page/CustomerAdministration/CustomerLists.vue'),
                    meta: { title: '客户列表' }
                },
                {
                    path: '/InternationalWaters',
                    component: () => import('../components/page/CustomerAdministration/InternationalWaters.vue'),
                    meta: { title: '公海' }
                },
                {
                    path: '/Deal',
                    component: () => import('../components/page/CustomerAdministration/Deal.vue'),
                    meta: { title: '监控中心' }
                },
                {
                    path: '/CustomerHome',
                    component: () => import('../components/page/CustomerAdministration/CustomerHome.vue'),
                    meta: { title: '二维码首页设置' }
                },
                {
                    path: '/Personnel',
                    component: () => import('../components/page/System/Personnel.vue'),
                    meta: { title: '人员管理' }
                },
                {
                    path: '/RolePermissions',
                    component: () => import('../components/page/System/RolePermissions.vue'),
                    meta: { title: '角色权限' }
                },
                {
                    path: '/RootIndex',
                    component: () => import('../components/page/System/RootIndex.vue'),
                    meta: { title: '系统设置' }
                },
                {
                    path: '/User',
                    component: () => import('../components/page/System/User.vue'),
                    meta: { title: '门店管理' }
                },
                {
                    path: '/DataStream',
                    component: () => import('../components/page/System/DataStream.vue'),
                    meta: { title: '数据分流' }
                },
                {
                    path: '/DataFrom',
                    component: () => import('../components/page/System/DataFrom.vue'),
                    meta: { title: '数据概况' }
                },
                {
                    path: '/examine',
                    component: () => import('../components/page/System/examine.vue'),
                    meta: { title: '审核管理' }
                },
                {
                    path: '/resourceCentre',
                    component: () => import('../components/page/System/resourceCentre.vue'),
                    meta: { title: '资源中心' }
                },
                {
                    path: '/informationFlow',
                    component: () => import('../components/page/System/informationFlow.vue'),
                    meta: { title: '信息流管理' }
                },
                {
                    path: '/resourceShare',
                    component: () => import('../components/page/System/resourceShare.vue'),
                    meta: { title: '资源分配' }
                },
                {
                    path: '/filterShare',
                    component: () => import('../components/page/System/filterShare.vue'),
                    meta: { title: '过滤分配' }
                },
                {
                    path: '/businessList',
                    component: () => import('../components/page/business/businessList.vue'),
                    meta: { title: '商家列表' }
                },
                {
                    path: '/productList',
                    component: () => import('../components/page/business/productList.vue'),
                    meta: { title: '产品列表' }
                },
                {
                    path: '/userManage',
                    component: () => import('../components/page/business/userManage.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/businessHome',
                    component: () => import('../components/page/business/businessHome.vue'),
                    meta: { title: '首页设置' }
                },
                {
                    path: '/businessTemplate',
                    component: () => import('../components/page/business/businessTemplate.vue'),
                    meta: { title: '商家模板' }
                },
                {
                    path: '/contractTemplate',
                    component: () => import('../components/page/business/contractTemplate.vue'),
                    meta: { title: '合同模板' }
                },
                {
                    path: '/investUser',
                    component: () => import('../components/page/business/investUser.vue'),
                    meta: { title: '投资人员' }
                },
                {
                    path: '/startBusiness',
                    component: () => import('../components/page/business/startBusiness.vue'),
                    meta: { title: '创业项目' }
                },
                {
                    path: '/orderManage',
                    component: () => import('../components/page/business/orderManage.vue'),
                    meta: { title: '订单管理' }
                },
                {
                    path: '/classManage',
                    component: () => import('../components/page/business/classManage.vue'),
                    meta: { title: '分类设置' }
                },
                {
                    path: '/userBlackList',
                    component: () => import('../components/page/business/userBlackList.vue'),
                    meta: { title: '用户黑名单' }
                },
                {
                    path: '/qrExamine',
                    component: () => import('../components/page/business/qrExamine.vue'),
                    meta: { title: '额度预审' }
                },

                {
                    path: '/StoreDataList',
                    component: () => import('../components/page/System/StoreDataList.vue'),
                    meta: { title: '门店数据列表' }
                },
                //====================联防页面===========
                {
                    path: '/jdDataList',
                    component: () => import('../components/page/jointDefence/jdDataList.vue'),
                    meta: { title: '信息列表' }
                },
                {
                    path: '/jdUserList',
                    component: () => import('../components/page/jointDefence/jdUserList.vue'),
                    meta: { title: '用户列表' }
                },
                {
                    path: '/jdEnterpriseList',
                    component: () => import('../components/page/jointDefence/jdEnterpriseList.vue'),
                    meta: { title: '认证企业' }
                },
                {
                    path: '/jdAgreement',
                    component: () => import('../components/page/jointDefence/jdAgreement.vue'),
                    meta: { title: '协议列表' }
                },
                {
                    path: '/jdPersonnelList',
                    component: () => import('../components/page/jointDefence/jdPersonnelList.vue'),
                    meta: { title: '人员列表' }
                },

                //========================= 会话存档 =====================
                {
                    path: '/sessionArchivinglist',
                    component: () => import('../components/page/sessionArchiving/list.vue'),
                    meta: { title: '会话存档' }
                },
                //========================= 日志管理 =====================
                {
                    path: '/meJournal',
                    component: () => import('../components/page/journal/meJournal.vue'),
                    meta: { title: '我的日志' }
                },
                {
                    path: '/journalList',
                    component: () => import('../components/page/journal/journalList.vue'),
                    meta: { title: '日志列表' }
                },
                {
                    path: '/journalchart',
                    component: () => import('../components/page/journal/chart.vue'),
                    meta: { title: '日志图表' }
                },
                //========================= 代代网官网 =====================
                {
                    path: '/website/dindex',
                    component: () => import('../components/page/website/dindex.vue'),
                    meta: { title: '首页设置' }
                },
                {
                    path: '/website/dclass',
                    component: () => import('../components/page/website/dclass.vue'),
                    meta: { title: '贷款分类' }
                },
                {
                    path: '/website/darticle',
                    component: () => import('../components/page/website/darticle.vue'),
                    meta: { title: '贷款知识' }
                },
                {
                    path: '/website/dabout',
                    component: () => import('../components/page/website/dabout.vue'),
                    meta: { title: '关于我们' }
                },
                {
                    path: '/website/dfast',
                    component: () => import('../components/page/website/dfast.vue'),
                    meta: { title: '快速申请' }
                },
                {
                    path: '/website/dorder',
                    component: () => import('../components/page/website/dorder.vue'),
                    meta: { title: '咨询订单' }
                },
                {
                    path: '/website/dproduct',
                    component: () => import('../components/page/website/dproduct.vue'),
                    meta: { title: '产品列表' }
                },
                {
                    path: '/website/dadviser',
                    component: () => import('../components/page/website/dadviser.vue'),
                    meta: { title: '顾问列表' }
                },
                {
                    path: '/website/donline',
                    component: () => import('../components/page/website/donline.vue'),
                    meta: { title: '在线咨询' }
                },
                {
                    path: '/website/duserlist',
                    component: () => import('../components/page/website/duserlist.vue'),
                    meta: { title: '账号列表' }
                },
                //========================= 在线培训 =====================
                {
                    path: '/study/videoManage',
                    component: () => import('../components/page/study/videoManage.vue'),
                    meta: { title: '视频管理' }
                },
                {
                    path: '/study/train',
                    component: () => import('../components/page/study/train.vue'),
                    meta: { title: '培训学习' }
                },
                {
                    path: '/study/questionBank',
                    component: () => import('../components/page/study/questionBank.vue'),
                    meta: { title: '题库管理' }
                },
                {
                    path: '/study/examination',
                    component: () => import('../components/page/study/examination.vue'),
                    meta: { title: '考试审核' }
                },

                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import('../components/page/BaseCharts.vue'),
                    meta: { title: 'schart图表' }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: { title: '国际化' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
